package com.inspur.icity.bus.restapi;

import com.inspur.icity.bus.api.user.task.TaskSaveRouteSite;
import com.inspur.icity.bus.base.core.model.BaseResult;
import com.inspur.icity.bus.base.core.web.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 首页Controller
 */
@Controller
@RequestMapping(value = "/home")
public class BusHomeController extends BaseController {

    @Autowired
    private TaskSaveRouteSite saveRouteSite;

    /**
     * 执行定时任务
     */
    @RequestMapping(value = "/task",method = RequestMethod.GET)
    @ResponseBody
    public Object task(){
        saveRouteSite.saveRouteSiteTask();
        return BaseResult.success("执行成功");
    }

}